/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.integration;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import model.dto.AvailabilityDTO;

/**
 *
 * @author Ahmed Salem
 */
@Entity
@Table(name = "availability", catalog = "greenland", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Availability.findAll", query = "SELECT a FROM Availability a"),
    @NamedQuery(name = "Availability.findByAvailabilityId", query = "SELECT a FROM Availability a WHERE a.availabilityId = :availabilityId"),
    @NamedQuery(name = "Availability.findByPersonId", query = "SELECT a FROM Availability a WHERE a.personId = :personId"),
    @NamedQuery(name = "Availability.findByFromDate", query = "SELECT a FROM Availability a WHERE a.fromDate = :fromDate"),
    @NamedQuery(name = "Availability.findByToDate", query = "SELECT a FROM Availability a WHERE a.toDate = :toDate")})
public class Availability implements Serializable,AvailabilityDTO {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "availability_id")
    private Integer availabilityId;
    @Column(name = "from_date")
    @Temporal(TemporalType.DATE)
    private Date fromDate;
    @Column(name = "to_date")
    @Temporal(TemporalType.DATE)
    private Date toDate;
    @Column(name = "person_id")
    private Integer personId;

    /**
     *
     */
    public Availability() {
    }

    /**
     *
     * @param availabilityId
     * @param personId
     * @param from
     * @param to
     */
    public Availability(Integer availabilityId,Integer personId,Date from,Date to) {
        this.availabilityId = availabilityId;
        this.personId = personId;
        this.fromDate = from;
        this.toDate = to;
    }
    
    /**** All the set methods of the Availability class *****
     * @param availabilityId 
     */ 
    public void setAvailabilityId(Integer availabilityId) {
        this.availabilityId = availabilityId;
    }

    /**
     *
     * @param personId
     */
    public void setPersonId(Integer personId) {
        this.personId = personId;
    }

    /**
     *
     * @param fromDate
     */
    public void setFromDate(Date fromDate) {
        this.fromDate = fromDate;
    }
 
    /**
     *
     * @param toDate
     */
    public void setToDate(Date toDate) {
        this.toDate = toDate;
    }/*** The end of the set methods *******/

    
    /**** All the set methods of the Availability class *****
     * @return 
     */ 
    @Override
     public Integer getPersonId() {
        return personId;
    }
     
    /**
     *
     * @return
     */
    @Override
     public Integer getAvailabilityId() {
        return availabilityId;
    }
    /**
     *
     * @return
     */
    @Override
    public Date getFromDate() {
        return fromDate;
    }
    /**
     *
     * @return
     */
    @Override
    public Date getToDate() {
        return toDate;
    }/*** The end of the get methods *******/

}
